package edu.upn.talbd.proventas.dal;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionManager {
    public static Connection getConnection() {        
        try {
           Class.forName("org.postgresql.Driver");

            String url = "jdbc:postgresql://localhost:5432/BDferrerey";
           
            String usuario = "postgres";
            String clave = "Morales!1";
            
            //String clave = "camaratru";
            return DriverManager.getConnection(url, usuario, clave);
        } catch (SQLException ex) {
            ex.printStackTrace();
            System.err.println("Error: "+ex.getMessage());
            System.out.println(ex.getErrorCode());
        } catch (Exception ex) {
            ex.printStackTrace();
            System.err.println("Error: "+ex.getMessage());
        }
        return null;
    }
}
